package com.mcxx.modules.miniSalvation.fundpay.dto;

import cn.afterturn.easypoi.excel.annotation.Excel;
import lombok.Data;
import org.springframework.beans.BeanUtils;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;

@Data
public class CarePersonFundPayExcelDTO extends BaseExcelEntity implements Serializable {

    private static final long serialVersionUID = -1;

    
    @Excel(name = "街道", width = 20)
    private String areaCode;
    
    @Excel(name = "社区", width = 20)
    private String countyCode;

    
    @Excel(name = "照料人姓名/机构名称", width = 20)
    private String name;

    
    @Excel(name = "照料人身份证/机构信用代码", width = 20)
    private String idcard;

    
    @Excel(name = "照料总金额", width = 14)
    private String fundNumber;

    
    @Excel(name = "照料人数", width = 10)
    private String personNumber;

    
    @Excel(name = "手机号码", width = 15)
    private String contactPhone;

    
    @Excel(name = "开户银行", width = 20)
    private String bankName;

    @Excel(name = "照料人/机构银行账号", width = 20)
    private String account;

    @Excel(name = "账号类型", width = 15, dict = "FUNDCAPITALTYPE")
    private String subsideProps;

    public static List<CarePersonFundPayExcelDTO> convertExcelDTO(List<FundPayMemberDTO> list) {
        List<CarePersonFundPayExcelDTO> results = new ArrayList<>();
        for (FundPayMemberDTO obj : list) {
            CarePersonFundPayExcelDTO target = new CarePersonFundPayExcelDTO();
            BeanUtils.copyProperties(obj,target);
            String fundNumber = obj.getFundNumber() == null ? "0" : String.valueOf(obj.getFundNumber());
            target.setFundNumber(fundNumber);
            String personNumber = obj.getPersonNumber() == null ? "0" : String.valueOf(obj.getPersonNumber());
            target.setPersonNumber(personNumber);
            results.add(target);
        }
        return results;
    }
}
